package com.ysm.smfu.food;

import android.support.v4.app.FragmentManager;
import android.support.v4.widget.SwipeRefreshLayout;

import com.ysm.smfu.R;
import com.ysm.smfu.activity.BaseActivity;

public class FoodMainActivity extends BaseActivity {

    private SwipeRefreshLayout swipeRefreshLayout;

    @Override
    protected void initViews() {
        super.initViews();
        setContentView(R.layout.activity_foodmain);
        initStatuBar();
        setNoSuitStatuBar();
        initFragment();
    }

    private void initStatuBar() {
        swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefresh);
    }

    /**
     * 加载fragemnt
     */
    private void initFragment() {
        FoodMainFragment fragment = new FoodMainFragment();
        FragmentManager fragmentManager = getSupportFragmentManager();
        fragmentManager.beginTransaction().replace(R.id.foodMainContainer, fragment).commit();
    }

    /**
     * 返还下拉刷新
     *
     * @return
     */
    public SwipeRefreshLayout getRefreshLayout() {
        return swipeRefreshLayout;
    }

}
